package com.starview.star.compiler.cafe.compile.cont;

import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodNode;

import com.starview.platform.data.type.Location;
import com.starview.star.compiler.ErrorReport;
import com.starview.star.compiler.cafe.compile.AutoBoxing;
import com.starview.star.compiler.cafe.compile.CafeDictionary;
import com.starview.star.compiler.cafe.compile.CodeContext;
import com.starview.star.compiler.cafe.compile.ISpec;

public class BoxCont implements IContinuation
{

  public BoxCont()
  {
  }

  @Override
  public ISpec cont(ISpec src, CafeDictionary cxt, Location loc, ErrorReport errors, CodeContext ccxt)
  {
    MethodNode mtd = ccxt.getMtd();
    InsnList ins = mtd.instructions;
    return AutoBoxing.boxValue(src.getType(), ins, cxt);
  }

  @Override
  public boolean isJump()
  {
    return false;
  }
}